<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/test',function(){
    return [
        ['id'=>1],
        ['id'=>2],
        ['id'=>3],
        ['id'=>4]
    ];
});

Route::get('/',function(){
    phpinfo();
});

//登录页面
Route::get('/admin/loginIndex','admin\adminController@loginIndex');
//登录
Route::get('/admin/login','admin\adminController@login');


  //关闭当前窗口父级刷新
Route::get('/admin/reload',function(){
    return view('admin.layout.reload');
});

//关闭当前窗口父级刷新 延迟
Route::get('/admin/redirect',function(){
    return view('admin.layout.redirect');
});

Route::group(['prefix'=>'admin','middleware'=>'adminRole'],function(){

    //主框架
    Route::get('/','admin\indexController@index');

    //欢迎页    
    Route::get('/welcome',function(){
        return view('welcome');
    })->name('welcome');
    

    //后台用户/强制删除
    Route::post('/admin/forceDeleteChecked','admin\adminController@forceDeleteChecked');
    //后台用户/批量软删除
    Route::post('/admin/deleteChecked','admin\adminController@deleteChecked');
    //后台用户/恢复/批量恢复
    Route::post('/admin/restoreChecked','admin\adminController@restoreChecked');
    //后台用户
    Route::resource('/admin','admin\adminController');


    //路由菜单/菜单资源路由
    Route::post('/menu/resource','admin\menuController@createResource');
    Route::post('/menu/cancelResource','admin\menuController@cancelResource');
    //路由菜单/批量软删除
    Route::post('/menu/deleteChecked','admin\menuController@deleteChecked');
    //路由菜单资源路由
    Route::resource('/menu','admin\menuController');


    
    //角色权限/强制删除
    Route::post('/role/forceDeleteChecked','admin\roleController@forceDeleteChecked');
    //角色权限/批量软删除
    Route::post('/role/deleteChecked','admin\roleController@deleteChecked');
    //角色权限/恢复/批量恢复
    Route::post('/role/restoreChecked','admin\roleController@restoreChecked');
    //角色权限资源路由
    Route::resource('/role','admin\roleController');


     //形状约束/强制删除
     Route::post('/shape/forceDeleteChecked','admin\shapeController@forceDeleteChecked');
     //形状约束/批量软删除
     Route::post('/shape/deleteChecked','admin\shapeController@deleteChecked');
     //形状约束/恢复/批量恢复
     Route::post('/shape/restoreChecked','admin\shapeController@restoreChecked');
     //形状约束资源路由
     Route::resource('/shape','admin\shapeController');


     //形状约束资源路由
     Route::resource('/category','admin\categoryController');


    //全部数据/强制删除
    Route::post('/data/forceDeleteChecked','admin\dataController@forceDeleteChecked');
    //全部数据/批量软删除
    Route::post('/data/deleteChecked','admin\dataController@deleteChecked');
    //全部数据/恢复/批量恢复
    Route::post('/data/restoreChecked','admin\dataController@restoreChecked');
    //全部数据资源路由
    Route::resource('/data','admin\dataController');
     

    //上传相关控制器
    Route::post('/photoUpload','admin\uploadController@photoUpload');
});
